/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.istia.gesstages.jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Entity
@Table(name = "offres")
public class Offer implements Serializable {

    public Offer() {
    }

    public Offer(String enonce, String titre, String entreprise, String adresse, String codePostal, String ville, Date dateOffre, Date dateEnvoi, Boolean visible, Boolean istia, User owner, String file, String maitre, Boolean archive) {
        this.enonce = enonce;
        this.titre = titre;
        this.entreprise = entreprise;
        this.adresse = adresse;
        this.codePostal = codePostal;
        this.ville = ville;
        this.dateOffre = dateOffre;
        this.dateEnvoi = dateEnvoi;
        this.visible = visible;
        this.istia = istia;
        this.owner = owner;
        this.file = file;
        this.maitre = maitre;
        this.archive = archive;
    }

    @Id
    @Column(name = "st_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    @Column(name = "st_version", nullable = false)
    private int version;
    @Column(name = "st_enonce", nullable = false, length = 9000)
    private String enonce;
    @Column(name = "st_titre", nullable = false, length = 255)
    private String titre;
    @Column(name = "st_entreprise", nullable = false, length = 255)
    private String entreprise;
    @Column(name = "st_adresse", nullable = false)
    private String adresse;
    @Column(name = "st_codepostal", nullable = false, length = 5)
    private String codePostal;
    @Column(name = "st_ville", nullable = false)
    private String ville;
    @Column(name = "st_dateoffre", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dateOffre;
    @Column(name = "st_dateenvoi", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dateEnvoi;
    @Column(name = "st_visible", nullable = false)
    private Boolean visible;
    @Column(name = "st_istia", nullable = false)
    private Boolean istia;
    @JoinColumn(name = "st_owner", nullable = false)
    @ManyToOne(fetch = FetchType.EAGER)
    private User owner;
    @Column(name = "st_file", nullable = false)
    private String file;
    @Column(name = "st_maitre", nullable = false)
    private String maitre;
    @Column(name = "st_archive", nullable = false)
    private Boolean archive;

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public Boolean getArchive() {
        return archive;
    }

    public void setArchive(Boolean archive) {
        this.archive = archive;
    }

    public String getCodePostal() {
        return codePostal;
    }

    public void setCodePostal(String codePostal) {
        this.codePostal = codePostal;
    }

    public Date getDateEnvoi() {
        return dateEnvoi;
    }

    public void setDateEnvoi(Date dateEnvoi) {
        this.dateEnvoi = dateEnvoi;
    }

    public Date getDateOffre() {
        return dateOffre;
    }

    public void setDateOffre(Date dateOffre) {
        this.dateOffre = dateOffre;
    }

    public String getEnonce() {
        return enonce;
    }

    public void setEnonce(String enonce) {
        this.enonce = enonce;
    }

    public String getEntreprise() {
        return entreprise;
    }

    public void setEntreprise(String entreprise) {
        this.entreprise = entreprise;
    }

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean getIstia() {
        return istia;
    }

    public void setIstia(Boolean istia) {
        this.istia = istia;
    }

    public String getMaitre() {
        return maitre;
    }

    public void setMaitre(String maitre) {
        this.maitre = maitre;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    public String getTitre() {
        return titre;
    }

    public void setTitre(String titre) {
        this.titre = titre;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getVille() {
        return ville;
    }

    public void setVille(String ville) {
        this.ville = ville;
    }

    public Boolean getVisible() {
        return visible;
    }

    public void setVisible(Boolean visible) {
        this.visible = visible;
    }
}
